<?php
$book = $_GET['book'] ?? '无';
if ($book == '无') {
    die('请输入要查找的书籍名');
}
require('../cofd/common.php');
$data = [];
$sql = "SELECT * FROM novel WHERE name LIKE '%".$book."%'";
$result = mysqli_query($conn, $sql);
if ($result && $result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $data[] = $row;
    }
} else {
    $data['msg'] = 404;
}
echo json_encode($data, JSON_UNESCAPED_UNICODE);
$conn->close();